package chapter4;
import java.util.Scanner;
/****************************************************************
 * Author：icynlau
 * Description:  把字母等级转换成数字  注意‘E’不再字母等级中
 * Date:2021/4/2
 * ***************************************************************
 */
public class exc4_14 {
	public static void main(String[] args) {
		Scanner input=new Scanner(System.in);
		System.out.print("Enter a letter grade: ");
		char grade=input.next().charAt(0);
		
		if(grade>='A'&&grade<='F'&&grade!='E') {
			if(grade=='F') {
				System.out.printf("The numberic value for grade %c is %d",grade,0 );
			}else {
				System.out.printf("The numberic value for grade %c is %d",grade,-(int)(grade-'E') );
			}
			
		}else {
			System.out.print(grade+" is an invalid grade.");
			System.exit(1);
		}
		
		
	}

}
